#include <iostream>
using namespace std;

int fn(int) {return int();}
typedef int(&fn_ref)(int);
typedef int&( *fn_ptr ) (int);

struct fn_class {
    int operator()(int i) {return i;}
};

/*template <class F, class... ArgTypes>*/
//class result_of<F(ArgTypes...)>;



int main(void)
{
    typedef std::result_of<decltype(fn) & (int)>::type A;
    typedef std::result_of<fn_ref(int)>::type B;
    typedef std::result_of<fn_ptr(int)>::type C;
    typedef std::result_of<fn_class(int)>::type D;


    std::cout << std::boolalpha;
    std::cout << "A: " << std::is_same<int, A>::value << endl;
    std::cout << "B: " << std::is_same<int, B>::value << endl;
    std::cout << "C: " << std::is_same<int, C>::value << endl;
    std::cout << "D: " << std::is_same<int, D>::value << endl;
    return 0;
}
